package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.android.volley.VolleyError;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.common.ApiConst;
import com.isunland.managesystem.common.VolleyResponse;
import java.util.HashMap;
import org.json.JSONException;

public class ReplyMassageFrag extends BaseVolleyActivity {

  private TextView et_reply_receivemassage;
  private String name;
  private String content;
  private EditText et_reply_sendmassage;
  private String sendcontext;
  private String id;
  private Button button;

  @Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // setContentView(R.layout.fragment_replymassage);
    et_reply_sendmassage = (EditText) findViewById(R.id.et_reply_sendmassage);

    name = getIntent().getStringExtra("name");
    content = getIntent().getStringExtra("content");
    id = getIntent().getStringExtra("id");
    et_reply_receivemassage = (TextView) findViewById(R.id.tv_reply_receivemassagecontext);
    et_reply_receivemassage.setText(content);
    sendcontext = et_reply_sendmassage.getText().toString();

    button = (Button) findViewById(R.id.button);
    button.setOnClickListener(new OnClickListener() {

      @Override public void onClick(View arg0) {

        volleyPostCheckUpdate();
      }
    });
  }

  private void volleyPostCheckUpdate() {
    String url = ApiConst.getAbsoluteUrl(ApiConst.URL_REPLYCONTEXT);
    // 参数是写死的.需要选择 部门,和人员.传id和name

    HashMap<String, String> params = new HashMap<String, String>();
    params.put("receiverId", "id");
    params.put("context", "sendcontext");
    this.volleyPost(url, params, new VolleyResponse() {

      @Override public void onVolleyResponse(String arg0) throws JSONException {

      }

      @Override public void onVolleyError(VolleyError arg0) {
        // Auto-generated method stub

      }
    });
  }
}
